package ch.fhnw.qualiscan.application.modals;

import java.util.List;

import ch.fhnw.qualiscan.application.models.SurveyModel;
import ch.fhnw.qualiscan.core.Modal;
import ch.fhnw.qualiscan.core.db.pojos.Category;

import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
import com.vaadin.ui.Button.ClickEvent;

import eu.livotov.tpt.i18n.TM;

@SuppressWarnings("serial")
public class CategoryHelper extends Modal {
	
	private SurveyModel surveyModel;
	private List<Category> categoryList;
	private Button cancelButton;
	
	public CategoryHelper() {
		
		this.setCaption(TM.get("categoryhelper.title"));
		surveyModel = new SurveyModel();
		categoryList = surveyModel.getCategories();
		buildLayout();
	}
	
	public void buildLayout() {
		
		for (int c = 0; c < categoryList.size(); c++) {
			Label title = textHelper.span("<strong>"+categoryList.get(c).getTitle()+"</strong>");
			Label text = textHelper.p(categoryList.get(c).getCategoryDescription().getText());
			this.addComponent(title);
			this.addComponent(text);
		}
		
	}

}
